package #(entityPackageName);

#for(importClass : table.buildImports(isBase))
import #(importClass);
#end

import java.io.Serial;

#if(!isBase)
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;


/**
 * #(table.getComment()) 实体类。
 *
 * @author #(javadocConfig.getAuthor())
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
#(table.buildTableAnnotation()) #end
public class #(entityClassName) implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

#for(column : table.columns)
    #set(comment = javadocConfig.formatColumnComment(column.comment))
    #if(hasText(comment))
    /**
     * #(comment)
     */
    #end
    #set(annotations = column.buildAnnotations())
    #if(hasText(annotations))
    #(annotations)
    #end
    #if((column.propertySimpleType) == "Date" && (column.property) == "createTime")
    @Column(onInsertValue = "now()")
    private #(column.propertySimpleType) #(column.property);

    #elseif((column.propertySimpleType) == "Date"  && (column.property) == "updateTime")
    @Column(onUpdateValue = "now()")
    private #(column.propertySimpleType) #(column.property);

    #else
    private #(column.propertySimpleType) #(column.property);

    #end
#end
}
